package net.towee.model.account.impl;

import net.towee.model.account.LoginzaAccount;

import com.google.code.morphia.annotations.Embedded;

/**
 * Simple implementation of loginza account data container
 * @author c58
 *
 */
@Embedded
public class LoginzaAccountImpl implements LoginzaAccount {
	private String identity;
	private String provider;

	public LoginzaAccountImpl() {}
	public LoginzaAccountImpl(String identity2, String provider2) {
		this.identity = identity2;
		this.provider = provider2;
	}

	@Override
	public String getIdentity() {
		return identity;
	}

	@Override
	public String getProvider() {
		return provider;
	}

	@Override
	public boolean equals(Object o){
		if(o == this)
			return true;
		
		if(o instanceof LoginzaAccount && ((LoginzaAccount)o).getIdentity().equals(getIdentity()) && 
				((LoginzaAccount)o).getProvider().equals( getProvider() )) 
			return true;

		return false;
	}
}
